package com.uusee.shipshape.gt.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "ss_gt_upload_user")
@SuppressWarnings("serial")
@SequenceGenerator(name = "SS_GT_UPLOAD_USER_SQ", sequenceName = "SS_GT_UPLOAD_USER_SQ", allocationSize = 1)
public class UploadUser implements Serializable {
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SS_GT_UPLOAD_USER_SQ")
	private long id;

	@Column(name = "source_site")
	private String sourceSite;

	@Column(name = "user_id")
	private String userId;

	private String username;
	private String logo;

	@Column(name = "user_blog_url")
	private String userBlogUrl;
	
	@Column(name = "is_da_ren")
	private String isDaRen = "N";

	@Column(name = "da_ren_type")
	private String daRenType = "";

	@Column(name = "video_count")
	private int videoCount;

	@Column(name = "playlist_count")
	private int playlistCount;
	
	@Column(name = "USER_LEVEL")
	private int level;
	
	@Column(name = "crawl_times")
	private int crawlTimes;
	
	@Column(name = "empty_video_times")
	private int emptyVideoTimes;
	
	@Column(name = "last_crawl_date")
	private Date lastCrawlDate;

	@Column(name = "update_user")
	private String updateUser;

	@Column(name = "update_date")
	private Date updateDate;
	
	@Transient
	private int maxPage;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getSourceSite() {
		return sourceSite;
	}

	public void setSourceSite(String sourceSite) {
		this.sourceSite = sourceSite;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getLogo() {
		return logo;
	}

	public void setLogo(String logo) {
		this.logo = logo;
	}

	public String getUserBlogUrl() {
		return userBlogUrl;
	}

	public void setUserBlogUrl(String userBlogUrl) {
		this.userBlogUrl = userBlogUrl;
	}

	public String getIsDaRen() {
		return isDaRen;
	}

	public void setIsDaRen(String isDaRen) {
		this.isDaRen = isDaRen;
	}

	public String getDaRenType() {
		return daRenType;
	}

	public void setDaRenType(String daRenType) {
		this.daRenType = daRenType;
	}

	public int getVideoCount() {
		return videoCount;
	}

	public void setVideoCount(int videoCount) {
		this.videoCount = videoCount;
	}

	public int getPlaylistCount() {
		return playlistCount;
	}

	public void setPlaylistCount(int playlistCount) {
		this.playlistCount = playlistCount;
	}
	
	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public int getCrawlTimes() {
		return crawlTimes;
	}

	public void setCrawlTimes(int crawlTimes) {
		this.crawlTimes = crawlTimes;
	}

	public int getEmptyVideoTimes() {
		return emptyVideoTimes;
	}

	public void setEmptyVideoTimes(int emptyVideoTimes) {
		this.emptyVideoTimes = emptyVideoTimes;
	}

	public Date getLastCrawlDate() {
		return lastCrawlDate;
	}

	public void setLastCrawlDate(Date lastCrawlDate) {
		this.lastCrawlDate = lastCrawlDate;
	}

	public String getUpdateUser() {
		return updateUser;
	}

	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}
	
	public int getMaxPage() {
		return maxPage;
	}

	public void setMaxPage(int maxPage) {
		this.maxPage = maxPage;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((sourceSite == null) ? 0 : sourceSite.hashCode());
		result = prime * result + ((userId == null) ? 0 : userId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UploadUser other = (UploadUser) obj;
		if (sourceSite == null) {
			if (other.sourceSite != null)
				return false;
		} else if (!sourceSite.equals(other.sourceSite))
			return false;
		if (userId == null) {
			if (other.userId != null)
				return false;
		} else if (!userId.equals(other.userId))
			return false;
		return true;
	}
	
	
}
